#ifndef _EXECUTE_H
#define _EXECUTE_H

#include "backend.h"
#include "evaluate.h"

enum execute_status {
	XC_NORMAL,
	XC_CONTINUE,
	XC_BREAK,
	XC_RETURN,
	XC_EVENTTRANS
};

struct execute_result {
	enum execute_status status;

	union {
		struct {
			struct evaluate_result evaluation;
		} x_return;
		struct {
			int eventindex;
		} x_trans;
	} spec;
};

void execute_list(struct execute_result *, int, struct statement *, struct access_table *, int);
void execute(struct execute_result *, struct statement *, struct access_table *, int);

void execute_input(int, struct evaluate_result *);
void execute_output(int, char *, struct access_table *, int);

#endif
